{% extends 'homepage.html' %}

{% block content %}

<script type="text/javascript" src="{{ url_for('static', filename='elliptic_modular_form_util-functions.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='elliptic_modular_form_scripts.js') }}"></script>
<script>
$(document).ready( function() {
$("#wait").text("Plot of fundamental domain is loading!");
$("#plot").load(function() {
         $("#wait").text("");
    });
}
);
</script>
{% if info.error is defined %}

<h1>There was an error in meeting your previous request. Please change parameters.</h1>

<div> 
<h2> Error message: </h2>
{{ info.error | safe }}
</div>
{% endif %}

{% if info.weight is defined %}
<h1>{{ KNOWL('mf.elliptic.newform',title='Newforms') }} of {{KNOWL('mf.elliptic.level',title='level')}} {{info.level}} and {{KNOWL('mf.elliptic.weight',title='weight')}} {{info.weight}}</h1>
{% else %}
<h1>{{ KNOWL('mf.elliptic.newform',title='Newforms') }} of {{KNOWL('mf.elliptic.level',title='level')}} {{info.level}}</h1>
{% endif %}

{% if info.browse_table is defined %}
{% if info.browse_table.rows is defined %}
{#{KNOWL('mf.ellipticemf_browse.all.info',title='Write about browsing') }#}
<p>
In the table below you can brose spaces of Holomorphic Cusp Forms with
given level and weight. The entry in the table is the dimension of the space.
</p>
{% set table = info.browse_table %}
{% set rows = info.browse_table.rows %}
{% set row_class = cycler('odd', 'even') %}
{% if info.show_all_characters is defined %}
{% set len = table.col_heads | length %}
{% set wid = 10*len +20 %}
<table class="ntdata" width="{{wid}}px">
  <thead>
    <tr>
      <th width="10px" style="border-right:1px solid black">
        {% if table.rowhead is defined %}
        {{ table.rowhead | safe }}
        {% endif %}
      </th>
      {% for ix in table.col_heads  %}
      <th width="10px">
        <a href="{{url_for('render_webpage_label',modulus=info.level,number=ix) }}" style="">{{ix}}</a></th>
      {% endfor %}
    </tr>
  </thead>
  <tbody>
    {% for row in rows  %}
    <tr class="{{row_class.next() }}">
      <th width="10px" style="background:#afa; border-right: 1px solid black">
        {{ table.row_heads[loop.index-1] }}

      </th>
      {% for cell in row  %}
      <td align="center" width="0%">
        <a style="" href="{{cell.url}}">{{cell.dim}}</a>
      </td>
      {% endfor %}
    </tr>
    {% endfor %}
  </tbody>
</table>
{% endif %}
{% endif %}
{% elif info.list_spaces is defined %}

{{ info.list_spaces | safe }}




{% endif %}

   {% if info.geometric is defined %}
      {% set G = info.geometric %}
      <table>
        <tr>
          <td valign="top">
            {% if info.level > 1 %}
            {% set level = info.level %}
            {% set ti = "\(\Gamma_{0}( " ~ level  ~ ") \)" %} 
            <h2>Geometric information for {{KNOWL('mf.sl2.subgroup.gamma0N',title=ti)}}</h2>
            {% else %}
            <h2>Geometric information for {{KNOWL('mf.sl2z',title='\(PSL_{2}(\mathbb{Z}) \)')}}</h2>
            {% endif %}
          </td>
        </tr>
        <tr>
          <td>
            <table>
              <tr><th>{{KNOWL('mf.sl2z.subgroup.index',title='index')}}</th><td>{{G.index}}</td></tr>
              <tr><th>{{KNOWL('mf.sl2z.subgroup.genus',title='genus')}}</th><td>{{G.genus}}</td></tr>
              <tr><th>{{KNOWL('mf.sl2z.subgroup.cusps',title='index')}}</th><td>{{G.cusps}}</td></tr>
              <tr><th colspan="2">Number of {{KNOWL('mf.sl2z.subgroup.ellipticfxpts',title='elliptic fixed points')}}</th></tr>
              <tr><th>order 2</th><td>{{G.nu2}}</td></tr>
              <tr><th>order 3</th><td>{{G.nu2}}</td></tr>
            </table>
          </td>
          {% endif %}
          {% if info.fd_plot is defined %}
          <td>
            <div>
              <span id="wait">      </span>
              <img id="plot" src="{{ info.fd_plot | safe }} " width="" height="75%"/>
            </div>
          </td>
        </tr>
      </table>
      {% endif %}

{% endblock content %}
